﻿CREATE PROCEDURE [dbo].[p_sys_GetModuleSerialNumber]
	@moduleName nvarchar(50)
AS
    declare @table Table( sn int)
	declare @sn int

	update sys_ModuleSerialNumber set SerialNumber=SerialNumber+1
	output inserted.SerialNumber into @table
	where ModuleName=@moduleName
	
	select @sn=sn from @table


RETURN @sn
